using System;
using System.Collections.Generic;
using System.ComponentModel;
using Iesi.Collections;
using Iesi.Collections.Generic;
using METODESA.Server.Data.Components;
using METODESA.Server.Data.Exceptions;
using METODESA.Server.Data.METODESA.Entity;

namespace METODESA.Server.Data.METODESA.Entity 
{    
	/// <summary>
	/// An object representation of the DetalleCompra table
	/// </summary>
	[Serializable]
	public partial class DetalleCompra
	{
		private System.Int32 _Id;

		private System.Int32 _Cantidad;
        private System.Double _Precio;
		private OrdenCompra _OrdenCompra;
		private Producto _Producto;


	  
	    public virtual System.Int32 Cantidad
		{
			get
			{
				return _Cantidad;
			}
			set
			{
				_Cantidad = value;
			}
		}
        public virtual System.Double Precio
        {
            get
            {
                return _Precio;
            }
            set
            {
                _Precio = value;
            }
        }

		public virtual System.Int32 Id
		{
			get
			{
				return _Id;
			}
			set
			{
				_Id = value;
			}
		}

		public virtual OrdenCompra OrdenCompra
		{
			get
			{
				return _OrdenCompra;
			}
			set
			{
				_OrdenCompra = value;
			}
		}
		public virtual Producto Producto
		{
			get
			{
				return _Producto;
			}
			set
			{
				_Producto = value;
			}
		}

		protected bool Equals(DetalleCompra entity)
		{
			if (entity == null) return false;
			if (!base.Equals(entity)) return false;
			if (!Equals(_Id, entity._Id)) return false;
			return true;
		}

		public override bool Equals(object obj)
		{
			if (ReferenceEquals(this, obj)) return true;
			return Equals(obj as DetalleCompra);
		}

		public override int GetHashCode()
		{
			int result = base.GetHashCode();
			result = 29*result + _Id.GetHashCode();
			return result;
		}

	}
}
